| else: |
| return ciphertext |
| if char in cipherKey: |
| ciphertext += char |
| char = string[x] |
| def encrypt(string,cipherKey): |
| newchar = cipherKey[char] |
| ciphertext = "" |
| for x in range(len(string)): |
| ciphertext += newchar |
|         else: |
|     return ciphertext |
|         if char in cipherKey: |
|             ciphertext += char |
|         char = string[x] |
| def encrypt(string,cipherKey): |
|             newchar = cipherKey[char] |
|     ciphertext = "" |
|     for x in range(len(string)): |
|             ciphertext += newchar |
| 1 | def encrypt(string,cipherKey): |
| 2 |     ciphertext = "" |
| 3 |     for x in range(len(string)): |
| 4 |         char = string[x] |
| 5 |         if char in cipherKey: |
| 6 |             newchar = cipherKey[char] |
| 7 |             ciphertext += newchar |
| 8 |         else: |
| 9 |             ciphertext += char |
| 10 |     return ciphertext |
| reverseSub[value] = key |
| reverseSub = {} |
| for key in substitution: |
| encrypt(cipherText,reverseSub) |
| value = substitution[key] |
|     reverseSub[value] = key |
| reverseSub = {} |
| for key in substitution: |
| encrypt(cipherText,reverseSub) |
|     value = substitution[key] |
| 1 | reverseSub = {} |
| 2 | for key in substitution: |
| 3 |     value = substitution[key] |
| 4 |     reverseSub[value] = key |
| 5 | encrypt(cipherText,reverseSub) |
| ciphertext += alphabet[i] |
| if i >= len(alphabet): |
| char = plaintext[x] |
| i = alphabet.index(char) |
| ciphertext += char |
| i += key |
| ciphertext = "" |
| else: |
| def ceasarCipher(plaintext,key): |
| i = i - len(alphabet) |
| return ciphertext |
| for x in range(len(plaintext)): |
| if char not in alphabet: |
|             ciphertext += alphabet[i] |
|             if i >= len(alphabet): |
|         char = plaintext[x] |
|             i = alphabet.index(char) |
|             ciphertext += char |
|             i += key |
|     ciphertext = "" |
|         else: |
| def ceasarCipher(plaintext,key): |
|                 i = i - len(alphabet) |
|     return ciphertext |
|     for x in range(len(plaintext)): |
|         if char not in alphabet: |
| 1 | def ceasarCipher(plaintext,key): |
| 2 |     ciphertext = "" |
| 3 |     for x in range(len(plaintext)): |
| 4 |         char = plaintext[x] |
| 5 |         if char not in alphabet: |
| 6 |             ciphertext += char |
| 7 |         else: |
| 8 |             i = alphabet.index(char) |
| 9 |             i += key |
| 10 |             if i >= len(alphabet): |
| 11 |                 i = i - len(alphabet) |
| 12 |             ciphertext += alphabet[i] |
| 13 |     return ciphertext |
| if len(plaintext) != len(key): |
| for i in range(len(plaintext)): |
| cipher_text += cipher_char |
| return cipher_text |
| plainInt = ord(plaintext[i]) |
| cipher_text = "" |
| def vernam_cipher(plaintext, key): |
| return "False" |
| newInt = plainInt ^ cipherInt |
| cipherInt = ord(key[i]) |
| cipher_char = chr(newInt) |
|     if len(plaintext) != len(key): |
|     for i in range(len(plaintext)): |
|         cipher_text += cipher_char |
|     return cipher_text |
|         plainInt = ord(plaintext[i]) |
|     cipher_text = "" |
| def vernam_cipher(plaintext, key): |
|         return "False" |
|         newInt = plainInt ^ cipherInt |
|         cipherInt = ord(key[i]) |
|         cipher_char = chr(newInt) |
| 1 | def vernam_cipher(plaintext, key): |
| 2 |     if len(plaintext) != len(key): |
| 3 |         return "False" |
| 4 | |
| 5 |     cipher_text = "" |
| 6 |     for i in range(len(plaintext)): |
| 7 |         plainInt = ord(plaintext[i]) |
| 8 |         cipherInt = ord(key[i]) |
| 9 |         newInt = plainInt ^ cipherInt |
| 10 |         cipher_char = chr(newInt) |
| 11 |         cipher_text += cipher_char |
| 12 |      |
| 13 |     return cipher_text |
| current_time = int(time.time() * 1000) |
| def simple_random_number(min_val=0, max_val=100): |
| return random_num |
| random_num = current_time % (max_val - min_val + 1) + min_val |
| import time |
|     current_time = int(time.time() * 1000) |
| def simple_random_number(min_val=0, max_val=100): |
|     return random_num |
|     random_num = current_time % (max_val - min_val + 1) + min_val |
| import time |
| 1 | import time |
| 2 | |
| 3 | def simple_random_number(min_val=0, max_val=100): |
| 4 |     current_time = int(time.time() * 1000) |
| 5 |      |
| 6 |     random_num = current_time % (max_val - min_val + 1) + min_val |
| 7 |     return random_num |